---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: d8:{{ .Chart.Name }}:flannel
  {{- include "helm_lib_module_labels" (list . (dict "app" "flannel")) | nindent 2 }}
rules:
  - apiGroups:
      - ""
    resources:
      - pods
    verbs:
      - get
  - apiGroups:
      - ""
    resources:
      - nodes
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - nodes/status
    verbs:
      - patch
      - get
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: d8:{{ .Chart.Name }}:flannel
  {{- include "helm_lib_module_labels" (list . (dict "app" "flannel")) | nindent 2 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: d8:{{ .Chart.Name }}:flannel
subjects:
- kind: ServiceAccount
  name: {{ .Chart.Name }}
  namespace: d8-{{ .Chart.Name }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ .Chart.Name }}
  {{- include "helm_lib_module_labels" (list . (dict "app" "flannel")) | nindent 2 }}
  namespace: d8-{{ .Chart.Name }}
